package logistic

import (
	"sync"
)

// AddressTopDto 结构体
type AddressTopDto struct {
	// first name of sender
	FirstName string `json:"first_name,omitempty" xml:"first_name,omitempty"`
	// last name of sender
	LastName string `json:"last_name,omitempty" xml:"last_name,omitempty"`
	// sender&#39;s country
	Country string `json:"country,omitempty" xml:"country,omitempty"`
	// zip code of ship from place
	ZipCode string `json:"zip_code,omitempty" xml:"zip_code,omitempty"`
	// sender&#39;s district and street
	Address string `json:"address,omitempty" xml:"address,omitempty"`
	// federal tax id(cnpj)
	FederalTaxId string `json:"federal_tax_id,omitempty" xml:"federal_tax_id,omitempty"`
	// sender&#39;s city
	City string `json:"city,omitempty" xml:"city,omitempty"`
	// sender&#39;s street number
	AddressNumber string `json:"address_number,omitempty" xml:"address_number,omitempty"`
	// cell phone of sender
	Cellphone string `json:"cellphone,omitempty" xml:"cellphone,omitempty"`
	// sender&#39;s State
	State string `json:"state,omitempty" xml:"state,omitempty"`
	// email of sender
	Email string `json:"email,omitempty" xml:"email,omitempty"`
	// shipping additional
	Additional string `json:"additional,omitempty" xml:"additional,omitempty"`
}

var poolAddressTopDto = sync.Pool{
	New: func() any {
		return new(AddressTopDto)
	},
}

// GetAddressTopDto() 从对象池中获取AddressTopDto
func GetAddressTopDto() *AddressTopDto {
	return poolAddressTopDto.Get().(*AddressTopDto)
}

// ReleaseAddressTopDto 释放AddressTopDto
func ReleaseAddressTopDto(v *AddressTopDto) {
	v.FirstName = ""
	v.LastName = ""
	v.Country = ""
	v.ZipCode = ""
	v.Address = ""
	v.FederalTaxId = ""
	v.City = ""
	v.AddressNumber = ""
	v.Cellphone = ""
	v.State = ""
	v.Email = ""
	v.Additional = ""
	poolAddressTopDto.Put(v)
}
